<style>

</style>
<template>
<!--  <van-swipe :lazy-render >-->

<!--  </van-swipe>-->
  <van-swipe @change="onChange">
        <van-swipe-item v-for="image in images" :key="image">
          <img :src="image" style="width:430px;height: 932px;">
        </van-swipe-item>
  </van-swipe>
  <div style="margin: 16px;position: absolute;top: 820px;left:3%" v-show="show">
    <van-button round block type="default" @click="submit">
      点击进入
    </van-button>
  </div>
</template>
<script setup>
import img1 from "@/img/1.png"
import img2 from "@/img/2.png"

import { showToast } from 'vant';

import {useRouter} from "vue-router";

const onChange = (index) =>{
  showToast('当前 Swipe 索引：' + index);
  if(index==1){
    show.value=true
  }else{
    show.value=false
  }
}

const router=useRouter()
const images = [
  img1,
  img2,
];
const show=ref(false);
// 点击进入按钮  进入到首页
const submit=()=>{
  router.push('/home')
}
</script>